package com.example.netty.netty.HTTPExample;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslHandler;

import javax.net.ssl.SSLEngine;

public class ServerInitializer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {

        socketChannel.pipeline()
                //netty提供的http消息聚合器+编解码器
                .addLast(new HttpServerCodec())
                .addLast("myHTTPServerHandler",new HTTPServerHandler());
    }
}
